// import FunderIndex from './funderIndex'
// import ViewIndex from './index'

// const funderRouter = {
//     path: 'resourceView',
//     // getChildRoutes(location, cb) {
//     //     require.ensure([], function (require) {
//     //     cb(null, [
//     //         {
//     //         path: 'list',
//     //         getComponents(nextState, cb) {
//     //             require.ensure([], function (require) {
//     //             cb(null, require('./resourceView/viewIndex'))
//     //             })
//     //         }
//     //         },
//     //     })
//     // },
//      getChildRoutes(location, cb) {
//         require.ensure([], function (require) {
//         cb(null, [
//             {
//             path: 'list',
//             getComponents(nextState, cb) {
//                 require.ensure([], function (require) {
//                 cb(null, require('./index'))
//                 })
//             }
//             },
//         })
//     },
//     indexRoute: {
//         getComponents(nextState, cb) {
//         require.ensure([], function (require) {
//             cb(null, ViewIndex)
//         })
//         return cb()
//         }
//     },

//     getComponents(nextState, cb) {
//         require.ensure([], function (require) {
//         cb(null, FunderIndex)
//         })
//     }
// }

// export default funderRouter;

import FunderIndex from './funderIndex'
import Index from './resourceView/list'


const funderRouter = {

  path: 'funder',
  getChildRoutes(location, cb) {
    require.ensure([], (require) => {
      cb(null, [
        {
          path: 'resource/list',
          getComponents(nextState, cb) {
            require.ensure([], function (require) {
              cb(null, require('./resourceView/list'))
            })
          }
        },

        {
          path: 'resource/detail',
          getComponents(nextState, cb) {
            require.ensure([], function (require) {
              cb(null, require('./resourceView/detail'))
            })
          }
        },
        {
          path: 'accountSetting/index',
          getComponents(nextState, cb) {
            require.ensure([], function (require) {
              cb(null, require('./accountSetting/index'))
            })
          }
        },{
          path: 'fundCount/list',
          getComponents(nextState, cb) {
            require.ensure([], function (require) {
              cb(null, require('./fundCount/list'))
            })
          }
        },{
          path: 'fundCount/detail',
          getComponents(nextState, cb) {
            require.ensure([], function (require) {
              cb(null, require('./fundCount/detail'))
            })
          }
        },{
          path: 'fundCount/outAccountInfo',
          getComponents(nextState, cb) {
            require.ensure([], function (require) {
              cb(null, require('./fundCount/outAccountInfo'))
            })
          }
        },{
          path: 'fundBook/list',
          getComponents(nextState, cb) {
            require.ensure([], function (require) {
              cb(null, require('./fundBook/list'))
            })
          }
        },{
          path: 'fundBook/detail',
          getComponents(nextState, cb) {
            require.ensure([], function (require) {
              cb(null, require('./fundBook/detail'))
            })
          }
        },{
          path: 'loanManagement/index',
          getComponents(nextState, cb) {
            require.ensure([], function (require) {
              cb(null, require('./loanManagement/index'))
            })
          }
        },{
          path:'fundRest/getCash',
          getComponents(nextState,cb){
            require.ensure([],function(require){
              cb(null,require('./fundRest/getCash'))
            })
          }
        },{
          path:'myCount',
          getComponents(nextState,cb){
            require.ensure([],function(require){
              cb(null,require('./fundRest/myCount'))
            })
          }
        },{
          path:'cashCenter',
          getComponents(nextState,cb){
            require.ensure([],function(require){
              cb(null,require('./fundRest/cashCenter'))
            })
          }
        },{
          path:'fundRest/record',
          getComponents(nextState,cb){
            require.ensure([],function(require){
              cb(null,require('./fundRest/record'))
            })
          }
        }
      ])
    })
  },
  indexRoute: {
    getComponents(location, cb) {
      require.ensure([], function (require) {
        cb(null, Index)
      })
      return cb();
    }
  },

  getComponents(nextState, cb) {
    require.ensure([], (require) => {
      cb(null, require('./funderIndex'))
    })
  }
}


export default funderRouter;
